<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>提交订单</title>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-touch-fullscreen" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<meta name="format-detection" content="address=no">
		<link rel="stylesheet" type="text/css" href="css/common.css">
		<link rel="stylesheet" type="text/css" href="css/index.css">
		<link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
		<link rel="stylesheet" href="css/reset.css">
		<script src="js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/iscroll.js"></script>
		<script type="text/javascript" src="js/jquery.flexslider-min.js"></script>
		<script src="js/hmt.js" type="text/javascript"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<script src="js/swiper.min.js" type="text/javascript" ></script>
		
		<script type="text/javascript" src="http://yanyubao.tseo.cn/Tpl/static/jquery.tmpl.js"></script>
		<script type="text/javascript" src="js/abot.js"></script>
		<script type="text/javascript" src="http://yanyubao.tseo.cn/api/shopapp.js"></script>
		<script type="text/javascript" src="js/abot.function.js"></script>
	</head>
	<body>
		<header class="hasManyCity hasManyCitytwo" id="header">
			<a href="javascript:history.go(-1)" class="fl fanhui">
			<i class="iconfont">&#xe6d4;</i></a>
			<div class="header-tit">
				订单确认
			</div>			
		</header>
		
		<div id="container">		
			<div id="main">
				<form class="wrapper-list">
					
					<dl class="list"  id="order_order">
					<script id="template_order_list" type="text/x-jquery-tmpl">
							<dd>
									<dd>
										<dl>
											<img src="${picture}" alt="" / width="50px" height="50px" align="left" style="padding:10px;">
										</dl>
										<dl>
											<h4>${name}</h4>
										</dl>
										
									</dd>
				
									<dd class="dd-padding kv-line-r">
										<h6>单价：</h6>
										<p><span>${price}</span>/人</p>
									</dd>
									<dd class="dd-padding dd-paddingtwo dd-paddingthree kv-line-r quantity">
										<h6>数量：</h6>
										<div class="kv-v">
											<div class="stepper">					
												<input class="mt number" type="tel" name="quantity" min="1" value="${amount}">
											</div>
										</div>									
									</dd>
							</dd>
							</script>
						</dl>
						
							<h4>收货地址：</h4>
						<dl class="list" id="mobile-show">
						<dd>
						
							<a class="react" href="address.html">
								<div class="more moretwo more-weak">
									<p style="margin-bottom:20px;">收货人：
									<span id="add_name" style="color:red;"></span></p>
									<p>收货地址：
									<span id="add_add" style="color:red;"></span></p>
								</div>
							</a>
					
						</dd>
					</dl>
						</dd>
					</dl>
					<dd class="dd-padding kv-line-r">
						<h6>总价：</h6>
						<span class="kv-v">
		            		<span id="totalPrice" class="J_total-price"></span>
		            		<span class="price-unit" id="zongjia" style="color:red;margin-right:21px;">0元</span>
							<span class="J_campaign-value"></span>
						</span>			
					</dd>
				 <div class="btn-wrapper">
						<a href="pay.html" type="submit" class="btn btn-block btn-strong btn-larger mj-submit" >提交订单</a>
					</div> 
				</form>
				
					
				
					
				
			</div>
		</div>
	</body>
	
	<script>
	
/* function zhifu_callback(res){
	$('#fangshi').tmpl(res.data).appendTo('#zhifufangshi');
}
 */
  product_id_str = sessionStorage["product_id"]
 
 //console.log(222222222)
 
 
 product_id_arr = product_id_str.split(",")//将传过来的字符串转化为数组
 
 console.log(product_id_arr)
 
 product_id_json = JSON.stringify(product_id_arr) 
 console.log(111121323)
 console.log(product_id_json)
 
function cart_list_callback(res){
		
			var arr_cart = res.address;
			var name = arr_cart.name;
			var address = arr_cart.address;
			$("#add_name").text(name)
			$("#add_add").text(address)
			var zong = res.all_price
			$("#zongjia").text(zong+"元")
			sessionStorage["zongprice"] = zong;
			var qwe = res.traffic_price;
			sessionStorage["traffic_price"] = qwe;
			 $('#template_order_list').tmpl(res.orderlist).appendTo('#order_order');	 	
}

$(function(){
	var loginItem = get_login_info();//获取登录信息 
	
	var userid = loginItem.userid;
	
	var checkstr = loginItem.checkstr;
	 
		//确认订单		
			var function_name = "order_queren";
			
			
			var request_data = {'userid':userid, 'checkstr':checkstr,'productid':product_id_json};
				
			 ajax_request_server(function_name,request_data, cart_list_callback);
			 
})
	
		
	</script>
</html>
